package com.itheima.iostream;

import java.io.FileOutputStream;
import java.io.IOException;

public class Dem04 {

    public static void main(String[] args) {
        FileOutputStream fos = null;
        try {
            System.out.println("A");
            fos = new FileOutputStream("day12\\dfgdfgdfg\\c.txt");
            fos.write("嘿嘿嘿,我最帅".getBytes());
        } catch (IOException e) {
            e.printStackTrace();
            System.out.println("B");
            //return;//finally优先级  高于return
            System.exit(0);//System.exit()高于一切 直接拉闸
        } finally {
            System.out.println("C");
            if (fos != null) {
                try {
                    fos.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }

        }
        System.out.println("D");

    }
}
